#ifndef BILLTEMPLATE_H
#define BILLTEMPLATE_H

#include <QString>
#include <QVector>
#include <QJsonObject>
#include <QJsonDocument>
#include <QFile>
#include <QDebug>
#include <QJsonArray>

struct FieldInfo {
    QString name;
    float x;
    float y;
    float width;
    float height;
    float fontSize;
};

class BillTemplate
{
public:
    BillTemplate();
    
    void addField(const QString& name, float x, float y, float width, float height, float fontSize = 10);
    bool saveToFile(const QString& filename);
    static BillTemplate loadFromFile(const QString& filename);
    
    QString templateName;
    float templateWidth;
    float templateHeight;
    QVector<FieldInfo> fields;
};

#endif // BILLTEMPLATE_H
